#include<iostream>
#include<map>
using namespace std;

int main(){
	freopen("input.txt","r",stdin);
	string s1,s2;
	map<char,int> m1,m2;
	cin>>s1>>s2;
	for(int i=0;i<s1.length();i++){
		m1[s1[i]]++;
	}
	for(int i=0;i<s2.length();i++){
		m2[s2[i]]++;
	}
	int duo=0,que=0;
	for(auto i: m2){
		if(i.second>m1[i.first]){
			que+=i.second-m1[i.first];
		}
	}
	duo=s1.length()-s2.length();
	if(que){
		cout<<"No"<<" "<<que;
	}else{
		cout<<"Yes"<<" "<<duo; 
	}
}